package com.zf.subapp01.controller;

import com.zf.subapp01.entity.Person;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ThreadLocalRandom;

/**
 *
 */
@RestController
@RequestMapping("/person")
public class PersonController {

    @GetMapping("/one")
    public Person welcome() {
        Person person = new Person();
        int nextInt = ThreadLocalRandom.current().nextInt(10) + 1;
        person.setName("张三" + nextInt);
        person.setAge(nextInt);
        return person;
    }
}
